home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / do1003.zip / COMM.SCR < prev    next >
Text File  |  1991-12-27  |  3KB  |  104 lines

  1. * - Variables ----------------------------------------------------------
  2. * Set these to meet your needs
  3. *
  4. * Times to try redial
  5. /SET Times 3
  6. *
  7. * Default Baud Rate
  8. /SET Baud 9600
  9. *
  10. * Default Phone Number.  Used in the /GETS command. You might want to
  11. * substitute the number you call most often.
  12. /SET Default 929-7511
  13. * ----------------------------------------------------------------------
  14. * Display the opening screen.  Note the use of the /BOX command to make
  15. * screen fancier.
  16.  
  17.                    »c 14 1«DO»re« Simple Communications Script»#«
  18.  
  19. /box 1 1 80 3 14 3 ""
  20. .go 1 10
  21. :TOP
  22. * Load the COMM.MAC macros.  These supply some default key codings
  23. * Use DoMacEd.EXE to examine this file or set your own.
  24. /MACROS 0 COMM.MAC
  25. /GETS Phone Default "»ye«Phone Number (»bo«<enter>»#« »cy«to exit script»ye«):»#« "
  26. /IF %Phone NE "" EXIT
  27. :COMM
  28. .clr go 2 5
  29. »ye«Starting Communications»#«
  30.  
  31. * NOTE: The InitCommunications command MUST be executed FIRST
  32. /INITCOM 1 %Baud n 8 1 ATM0&M0&D2&C1X4V1E1Q0
  33. *
  34. * Set up the various strings to wait for to detect the modem speed
  35. * This will allow the script to reset the COM: port if the modems
  36. * connect at a speed other than the default. Set these strings
  37. * to those issued by your modem.
  38. /SETWAIT busy BUSY
  39. /SETWAIT connect1200 "CONNECT 1200"
  40. /SETWAIT connect2400 "CONNECT 2400"
  41. /SETWAIT connect9600 "CONNECT 9600"
  42. /SETWAIT NoCarrier "NO CARRIER"
  43. *
  44. :DIAL
  45. *
  46. * Set RedialCount to control the number of times the script attempts
  47. * the number.  It is checked against TIMES set above.
  48. /MATH RedialCount 0
  49. *
  50. * A repeat loop is used to control script execution.  It will execute
  51. * until RedailCount is greater than or equal to Times or a connection
  52. * is made.
  53. /REPEAT
  54. *
  55. * Dial the phone number.  NOTE the addition of "ATDT" to signal to the
  56. * Hayes-compatible modem that it is to dial the number.
  57. /DIAL ATDT%phone
  58. *
  59. * Wait 45 seconds for one of the strings set in the /SETWAIT commands
  60. * above
  61. /WAIT 45
  62. *
  63. * The result of the /WAIT command is placed in the variable "FOUND".
  64. * Check it to make sure that it is equal to one of the connected
  65. * results. (All of them start with "CONNECT" so the like operator
  66. * can be used.
  67. /IF %found LK CONNECT* NoConnect
  68. *
  69. * Eliminate the "CONNECT " part of the string leaving only the
  70. * connect speed.  Load this into the variable BAUD and use it
  71. * in the /INITCOM command to reset the modem speed.
  72. /SUBST baud %found "connect " ""
  73. /INITCOM 1 %baud N 8 1
  74. .bell
  75. *
  76. * This starts the actual full-screen terminal session.  Press <alt-X>
  77. * to exit terminal mode. Exit the script when done.
  78. /TERM
  79. /GOTO EXIT
  80. *
  81. * If there was no connection, the script branches to this point.
  82. :NOCONNECT
  83. *
  84. * Increment the RedialCount variable and display the result.
  85. /INC RedialCount
  86.  
  87. »ye«Connection not made »re«%found»ye« (Retries : »gr«%RedialCount(###)»ye«)
  88. »#«
  89. *
  90. * Check RedialCount against Times and if it is greater-than or equal-to
  91. * it, exit the loop.  Otherwise go to the command after the /REPEAT
  92. * statement and try again.
  93. /UNTIL %RedialCount(@@@) GE %Times
  94. :EXIT
  95.  
  96. Terminating Communications
  97. *
  98. * Be sure to use the /CLOSECOM command to remove the communications buffers
  99. * and close the communications down.  This is especially important if you
  100. * will continue execution in this or another script.
  101. /CLOSECOM
  102. /ENDEXEC CLEAR
  103. * end of script
  104.